package com.itstu.gulimall.order.web;

import com.itstu.gulimall.order.service.OrderService;
import com.itstu.gulimall.order.vo.OrderSubmitVo;
import com.itstu.gulimall.order.vo.SubmitOrderResponseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author shhjiang_001
 * @create 2020-06-02 19:29
 */
@Controller
public class OrderWebController {
    @Autowired
    OrderService orderService;

    @GetMapping("/toTrade")
    public String toTrade(Model model){
        OrderSubmitVo orderSubmitVo = new OrderSubmitVo();
        orderSubmitVo.setAddr("杭州");
        SubmitOrderResponseVo vo = orderService.submitOrder(orderSubmitVo);
        model.addAttribute("submitResponse",vo);
        return "confirm";
    }
}
